//
//  HeaderView.m
//  列表
//
//  Created by LittleX on 16/2/20.
//  Copyright © 2016年 LittleX. All rights reserved.
//

#import "HeaderView.h"

@implementation HeaderView

-(instancetype)initWithFrame:(CGRect)frame
{
    self =[super initWithFrame:frame];
    if (self) {
        _listHeaderBtn =[[UIButton alloc]initWithFrame:CGRectMake(0,0 , SCREEN_WIDTH, 40*Height)];
        [_listHeaderBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        _listHeaderBtn.backgroundColor =[UIColor whiteColor];
        [_listHeaderBtn addTarget:self action:@selector(listData) forControlEvents:UIControlEventTouchUpInside];
        [_listHeaderBtn setTitleColor:COLOR_GREEN forState:UIControlStateNormal];
        _listHeaderBtn.imageEdgeInsets=UIEdgeInsetsMake(12.5*Height, 5*Width, 12.5*Height, SCREEN_WIDTH-15*Width);
        _listHeaderBtn.titleEdgeInsets=UIEdgeInsetsMake(0, 10*Width, 0, 0*Width);
        [self addSubview:_listHeaderBtn];
        _listHeaderBtn.titleLabel.font=[UIFont systemFontOfSize:14];
        _listHeaderBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
       
        _numLabel =[[UILabel alloc]initWithFrame:CGRectMake(260, 0, 50, 40)];
        _numLabel.font =[UIFont systemFontOfSize:12];
        _numLabel.textAlignment=NSTextAlignmentRight;
        [self addSubview:_numLabel];
        

        
    }
    return self;
}
-(void)listData
{
    if ([self.delegate respondsToSelector:@selector(headerDelegate:)]) {
        [self.delegate headerDelegate:self];
    }
}
@end
